package com.zznode.redsun.commons.sercurity.mapper;

import java.util.Collection;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.zznode.redsun.commons.sercurity.model.Account;
import com.zznode.redsun.commons.sercurity.model.Permission;
import com.zznode.redsun.commons.sercurity.model.Role;

public interface SecurityMapper {

	Collection<Map<String, String>> findUserRoles(@Param("loginName") String loginName);

	Account getAccount(@Param("loginName") String loginName);

	Collection<Role> findRoles(@Param("loginName") String loginName);

	Collection<Permission> findPermissions(@Param("loginName") String loginName);

	Collection<Role> findAllRoles();

	Collection<Permission> findRolePermissions(@Param("roleId") String roleId);

	Collection<Permission> findChoosablePermissions(@Param("roleId") String roleId);

	Collection<Account> findAllAccounts();

	Collection<Role> findAccountRoles(@Param("accountId") String accountId);

	Collection<Role> findChoosableRoles(@Param("accountId") String accountId);
}
